// 登录注册
function loginClick() {
	var a = document.getElementById('windowContext');
	var b = document.getElementById('registerWindow');
	var c = document.getElementById('loginWindow');
	var d = document.getElementById('shopcar');

	a.style.display = "block";
	b.style.display = "none";
	c.style.display = "block";
	d.style.display = "none";
}

function registerClick(){
	var a = document.getElementById('windowContext');
	var b = document.getElementById('registerWindow');
	var c = document.getElementById('loginWindow');
	var d = document.getElementById('shopcar');

	a.style.display = "block";
	b.style.display = "block";
	c.style.display = "none";
	d.style.display = "none";


}
//关闭登录注册
function closeclick(){
	var a = document.getElementById('windowContext');
	var b = document.getElementById('registerWindow');
	var c = document.getElementById('loginWindow');
	var d = document.getElementById('shopcar');

	a.style.display = "none";
	b.style.display = "none";
	c.style.display = "none";
	d.style.display = "none";
}

// 注册确认
function repwequal() {
	var a = document.getElementById('repwid');
	var b = document.getElementById('renewpwid');
	if(a.value == b.value){
		return true;
	}else{
		alert("密码输入不正确！请检查输入");
		return false;
	}
}

//菜名显示
(function() {
	function init() {
		var speed = 330,
			easing = mina.backout;

		[].slice.call ( document.querySelectorAll( '#grid > a' ) ).forEach( function( el ) {
			var s = Snap( el.querySelector( 'svg' ) ), path = s.select( 'path' ),
				pathConfig = {
					from : path.attr( 'd' ),
					to : el.getAttribute( 'data-path-hover' )
				};

			el.addEventListener( 'mouseenter', function() {
				path.animate( { 'path' : pathConfig.to }, speed, easing );
			} );

			el.addEventListener( 'mouseleave', function() {
				path.animate( { 'path' : pathConfig.from }, speed, easing );
			} );
		} );
	}

	init();

})();

